<template>
  <div>
    <el-pagination class="page" background layout="total, prev, pager, next, jumper" :total="pageInfo.total" @current-change="currentChange" />
  </div>
</template>
<script setup lang="ts">
import { withDefaults } from 'vue'
import type { pageInfoType } from './type'
let props = withDefaults(defineProps<{
  pageInfo: pageInfoType
}>(), {
  pageInfo: () => {
    return {
      total: 0,
      page: 1
    }
  }
})
let emits = defineEmits<{
  (e: 'currentChange', item: number): void
}>()
const currentChange = (e: number) => {
  emits('currentChange', e)
}
</script>
<style scoped lang="scss">
.total {
  float: left;
}
.page {
  display: flex;
  justify-content: end;
  margin-top: 10px;
}
</style>
